#pragma once

// cpu
#include "base_component.h"

class AGX : public BaseComponent {
public:
    // Remove the implementation code inside the selection.
    AGX();
    void print() override;
    int save(YAML::Node& node) override;
    int setAgxModel(std::string model);
    void setAiPerformance(const std::string& performance);
    void setCudaCores(int cores);
    void setTensorCores(int cores);
    void setGpuMemorySize(int size);
    void setMemorySize(int size);

private:
    std::string _agxModel;
    std::string _aiPerformance;
    int _cudaCores;
    int _tensorCores;
    int _gpuMemorySize;
    int _memorySize;
};

namespace YAML {
template <>
struct convert<AGX> {
    // 反序列化方法
    static bool decode(const Node& node, AGX& obj) {
        obj.setAgxModel(node["agxModel"].as<std::string>());
        obj.setAiPerformance(node["aiPerformance"].as<std::string>());
        obj.setCudaCores(node["cudaCores"].as<int>());
        obj.setTensorCores(node["tensorCores"].as<int>());
        obj.setGpuMemorySize(node["gpuMemorySize"].as<int>());
        obj.setMemorySize(node["memorySize"].as<int>());
        return true;
    }
};
}  // namespace YAML